AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( "shared.lua" )

function ENT:SetTrail (trail)
	if trail then
		printd ("trail:", trail)
		trail:SetColor (Color(255,0,255,255))
	end
end

function ENT:PhysicsCollide()
	
end

function ENT:Detonate()
	if self.Detonated then return end
	self.Detonated = true
	local expl = ents.Create ("env_explosion")
	expl:SetKeyValue ("iMagnitude", 75)
	expl:SetKeyValue ("spawnflags", 144)
	expl:Spawn ()
	expl:SetPos (self.Entity:GetPos())
	expl:SetOwner (self.Entity:GetOwner())
	expl:Fire ("Explode", "", 0.01)
	expl:Fire ("Kill", "", 0.1)
	if self.Entity.trail then
		printd ("got trail")
		self.Entity.trail:SetParent (self.Entity.trail)
		self.Entity.trail:Fire ("Kill", 0.5)
	end
	self.Entity:Fire ("Kill", 0.1)
end
